/*
 * Copyright (c) 2025, 廖树财, <study_2030@163.com>
 *
 * PES1.0.3-YCYW is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2     
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
#pragma once
#include "http.h"
#include "container.h"

extern char *DOCKER_URL;
extern char *DOCKER_SOCK;
extern char *DOCKER_PATH;
extern sqlite3 *g_sqlite3_db;
CURLcode docker_http_req(char *url, char *postParams, int req, int action, MemoryStruct *response);

bool container_sql_insert(IOTA_CONTAINER_INFO param, char *id);

bool container_sql_search(char *containerid, char *id);

bool container_sql_delete(char *containerid);

int container_install_json(char **pcJson, IOTA_CONTAINER_INFO param, char *imageName);

int container_docker_install(IOTA_CONTAINER_INFO param);

int container_docker_uninstall(IOTA_CONTAINER_CTRL param);

int container_docker_start(IOTA_CONTAINER_CTRL param);

int container_docker_stop(IOTA_CONTAINER_CTRL param);

int container_docker_clone(IOTA_CONTAINER_INFO param);

int container_docker_update(IOTA_CONTAINER_CTRL param);
